Skip to content

Conversation

@grendello
Copy link
Contributor

@grendello grendello commented Dec 11, 2025

This pull request introduces improvements to how Android runtime variants are handled in device integration tests. The key change is to parameterize tests by AndroidRuntime, ensuring that each runtime uses a unique package name and configuration. This prevents cross-runtime interference and enables broader test coverage. Additionally, a utility method is introduced to standardize package name generation.

Test parameterization and runtime handling:

  • Major device integration tests (LocalizationTests, TimeZoneInfoTests, SystemApplicationTests, UncaughtExceptionTests, MonoAndroidExportTest, and MarshalMethodsGCHangTests) are updated to run against all AndroidRuntime values using [Values] or [TestFixtureSource], with appropriate handling for unsupported configurations and unique per-runtime package names.

  • Tests now set the runtime explicitly on XamarinAndroidApplicationProject and related objects, and adjust build configurations such as IsRelease and SupportedOSPlatformVersion based on the runtime.

Utility and infrastructure improvements:

  • A new PackageUtils.MakePackageName method is added to generate unique package names per runtime, and is used throughout the updated tests to avoid conflicts.

  • Test project creation and setup now use the test name and runtime to ensure isolation and reproducibility.

Test codebase maintenance:

  • Imports for Xamarin.Android.Tasks are added to relevant test files to support the new runtime and package utilities.

These changes collectively improve test reliability and coverage across different Android runtime implementations.

On-device tests which run the same project but with different runtimes must
use different package names or we might find ourselves in a situation when
an application built for a different runtime and installed over a previous
version which uses another runtime, won't even start. This happened with
NativeAOT in the InstallAndRunTests.DotNetRun test.
@grendello grendello force-pushed the dev/grendel/test-runtimes-14 branch from 1668ab8 to 834ad60 Compare December 12, 2025 08:38
@jonathanpeppers jonathanpeppers merged commit fbc6689 into main Jan 7, 2026
59 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/grendel/test-runtimes-14 branch January 7, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants